package pl.edu.agh.xls2html.htmlelements;
import static org.junit.Assert.*;

import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.junit.Before;
import org.junit.Test;

public class RowTest {
	private HSSFWorkbook wb;	
	private HSSFSheet sheet;
	private HSSFRow row;		
	private HSSFCell cell;
//	private HSSFCell cell2;
	
	private Document doc;
	private Cell testcell;
	private Row testRow;

	@Before
	public void setUp() throws Exception {
		wb = new HSSFWorkbook();
		sheet =  wb.createSheet();
		row = sheet.createRow(0);
		cell = row.createCell(0);
//		cell2 = row.createCell(1);
		doc = new Document(wb);
		
		testRow = new Row(row,wb,doc);
	}	
	
	@Test
	public void testRowHTML(){
		assertEquals("\t<tr>\n"+
		"\t\t<td class=\"A1\" ><input id=\"A1\" value=\"\" /></td>\n"+
		"\t</tr>\n", testRow.getHTML());
	}
	
	@Test
	public void testRowCSS(){
		testcell = new Cell(cell,wb,doc);
		assertEquals(testcell.getCSS(), testRow.getCSS());
	}
	
	@Test
	public void testRowLength(){
		
		assertEquals(1, testRow.getRowLength());
	}
	
	

}
